package com.asset.dispoal.channel.service.common;

import com.asset.dispoal.channel.domain.db.mapper.SysChannelMapper;
import com.asset.dispoal.channel.dto.SysChannelPayRequest;
import com.asset.dispoal.channel.dto.SysChannelPayResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.mhuang.pacebox.core.ddd.BaseCommand;
import tech.mhuang.pacebox.springboot.protocol.Result;

import java.util.List;

/**
 * @author qr
 * @date 2022/3/25$
 */
@Component
public class SysChannelPayQueryByOpenIdCommand implements BaseCommand<SysChannelPayRequest, Result<List<SysChannelPayResponse>>> {


    @Autowired
    SysChannelMapper sysChannelMapper;

    @Override
    public Result<List<SysChannelPayResponse>> execute(SysChannelPayRequest request) {
        return Result.ok(sysChannelMapper.queryByOpenId(request.getOpenId()));
    }
}
